<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .html{
            width: 200px;
            height: 200px;
            background-color: red;
        }
        .css{
            background-color: aqua;
        }
        .current{
            color: red;
        }
        .play{
            display: none;
        }
    </style>
</head>
<body>
    <ul>
        <li class="current">html</li>
        <li>css</li>
    </ul>
    <div class="parent">
        <div class="html"></div>
        <div class="html css play"></div>
    </div>
    <script>
        var li = document.getElementsByTagName("li");
        var div = document.querySelectorAll(".parent div");

        for(let i=0;i<li.length;i++){
            li[i].index = i;
            li[i].onclick = function(event){
                for(let k=0;k<li.length;k++){
                    li[k].classList.remove("current");
                }
                this.classList.add("current")

                for(let k=0;k<li.length;k++){
                    div[k].style.display="none";
                }
                div[i].style.display = "block"
            }
        }
    </script>
</body>
</html>